  const tableRef = ref()

  const toolConfig = { refresh: false, height: false, columnSetting: false, striped: false }

  const columns = [
    {
      title: '序号',
      customRender: (i) => i.index + 1,
      align: 'center',
      width: 60
    },
    <%_ for(var i = 0; i < tableConfig.columns.length; i++){ _%>
    {
      title: '<%= tableConfig.columns[i].title %>',
      dataIndex: '<%= tableConfig.columns[i].dataIndex %>',
      align: 'center',
      width: <%= tableConfig.columns[i].width %>,
      ellipsis: true
    },
    <%_ } _%>
    {
      title: '操作',
      dataIndex: 'action',
      align: 'center',
      width: 160,
      fixed: 'right'
    }
  ]

  const loadData = () => {
    return Promise.resolve({ records: <%- JSON.stringify(tableConfig.data,null,2) %> })
  }

  const handleAdd = () => {
    formRef.value.onOpen(null, 'add')
  }

  const handleEdit = (record) => {
    formRef.value.onOpen(record,'edit')
  }

  const checkDetail = (record) => {
    formRef.value.onOpen(record,'detail')
  }

  const handleDel = async ({ id }) => {
    try {
      await testApi.doDel([{ id }])
      refresh()
      message.success('删除成功')
    } catch (e) {
      console.log(e)
    }
  }